{template '_header'}
<style type="text/css">
    .fui-navbar ~ .fui-content, .fui-content.navbar{padding:0;}
    .fui-list-group{margin-top:0;}
    .log-optiontitle{font-size:0.6rem;color:#999;}
</style>
<link rel="stylesheet" href="../addons/ewei_shopv2/plugin/creditshop/template/mobile/default/images/common.css" />
<link rel="stylesheet" href="../addons/ewei_shopv2/plugin/creditshop/static/css/common.css" />
<div class='fui-page  order-list-page'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back"></a>
        </div>
        <div class="title">我的</div>
        <div class="fui-header-right"></div>
    </div>
    <div id="tab" class="fui-tab fui-tab-danger">
        <a data-tab="tab0"  class="external {if $_GPC['status']=='0'|| empty($_GPC['status'])}active{/if}" data-status='0'>全部记录</a>
        <a data-tab="tab1"  class="external {if $_GPC['status']=='1'}active{/if}" data-status='1'>兑换记录</a>
        <a data-tab="tab2" class="external {if $_GPC['status']=='2'}active{/if}"  data-status='2'>中奖记录</a>
    </div>

    <div class='fui-content navbar'>

        <div class="fui-message fui-message-popup in content-empty" style="display: none; margin: 0; padding: 0; position: relative;">
            <div class="icon ">
                <i class="icon icon-information"></i>
            </div>
            <div class="content">未找到任何记录~</div>
        </div>

        <div class="fui-list-group noborder nomargin container"></div>
        <div class='infinite-loading' style="text-align: center; color: #666;">
            <span class='fui-preloader'></span>
            <span class='text'> 正在加载...</span>
        </div>
    </div>
    <script id='tpl_log_list' type='text/html'>
        <%each list as item%>
        <div class="creditshop-log-list-a" style="border-bottom:0.5rem solid #eee;">
            <div class="creditshop-log-header fui-list" style="border-bottom:1px solid #e9e9e9;">
                <div class="fui-list-media" style="color:#666;font-size:0.7rem;">订单号：<%item.logno%></div>
                <div class="fui-list-inner" style="text-align:right;font-size:0.7rem;color:#f60;">
                    <%if item.type==0%>
                        <%if item.goodstype==0%>
                            <%if item.isverify==1%>
                                <%if item.status ==2%>待兑换<%/if%>
                                <%if item.isreply == 1%>
                                    <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                    <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                    <%if item.status ==3 && item.iscomment == 2 %>已完成<%/if%>
                                <%else%>
                                    <%if item.status ==3%>已完成<%/if%>
                                <%/if%>
                            <%else%>
                                <%if item.status ==2 && item.addressid == 0 %>已兑换<%/if%>
                                <%if item.status ==2 && item.addressid > 0 && item.time_send == 0 %>待发货<%/if%>
                                <%if item.status ==3 && item.addressid > 0 && item.time_send == 0%>待发货<%/if%>
                                <%if item.status ==3 && item.time_send > 0 && item.time_finish == 0 %>待收货<%/if%>
                                <%if item.isreply == 1%>
                                    <%if item.status ==3 && item.time_finish > 0 && item.iscomment == 0 %>待评价<%/if%>
                                    <%if item.status ==3 && item.time_finish > 0 && item.iscomment == 1 %>追加评价<%/if%>
                                    <%if item.status ==3 && item.time_finish > 0 && item.iscomment == 2 %>已完成<%/if%>
                                <%else%>
                                    <%if item.status ==3%>已完成<%/if%>
                                <%/if%>
                            <%/if%>
                        <%else if item.goodstype==1%>
                            <%if item.isreply == 1%>
                                <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 2 %>已发放<%/if%>
                            <%else%>
                                <%if item.status ==3%>已发放<%/if%>
                            <%/if%>
                        <%else if item.goodstype==2%>
                            <%if item.isreply == 1%>
                                <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 2 %>已发放<%/if%>
                            <%else%>
                                <%if item.status ==3 %>已发放<%/if%>
                            <%/if%>
                        <%else if item.goodstype==3%>
                            <%if item.status ==2 %>待领取<%/if%>
                            <%if item.isreply == 1%>
                                <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 2 %>已发放<%/if%>
                            <%else%>
                                <%if item.status ==3%>已发放<%/if%>
                            <%/if%>
                        <%/if%>
                    <%else%>
                        <%if item.goodstype==0%>
                            <%if item.isverify==1%>
                                <%if item.status ==2%>待兑换<%/if%>
                                <%if item.isreply == 1%>
                                    <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                    <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                    <%if item.status ==3 && item.iscomment == 2 %>已完成<%/if%>
                                <%else%>
                                    <%if item.status ==3%>已完成<%/if%>
                                <%/if%>
                            <%else%>
                                <%if item.status ==2 && item.addressid == 0%>已中奖<%/if%>
                                <%if item.status ==2 && item.addressid > 0%>待收货<%/if%>
                                <%if item.isreply == 1%>
                                    <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                    <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                    <%if item.status ==3 && item.iscomment == 2 %>已完成<%/if%>
                                <%else%>
                                    <%if item.status ==3%>已完成<%/if%>
                                <%/if%>
                            <%/if%>
                        <%else if item.goodstype==1%>
                            <%if item.isreply == 1%>
                                <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 2 %>已发放<%/if%>
                            <%else%>
                                <%if item.status ==3 %>已发放<%/if%>
                            <%/if%>
                        <%else if item.goodstype==2%>
                            <%if item.isreply == 1%>
                                <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 2 %>已发放<%/if%>
                            <%else%>
                                <%if item.status ==3 %>已发放<%/if%>
                            <%/if%>
                        <%else if item.goodstype==3%>
                            <%if item.status ==2 %>待领取<%/if%>
                            <%if item.isreply == 1%>
                                <%if item.status ==3 && item.iscomment == 0 %>待评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 1 %>追加评价<%/if%>
                                <%if item.status ==3 && item.iscomment == 2 %>已发放<%/if%>
                            <%else%>
                                <%if item.status ==3 %>已发放<%/if%>
                            <%/if%>
                        <%/if%>
                        <%if item.status==1%>未中奖<%/if%>
                    <%/if%>
                </div>
            </div>
            <a data-nocache='true' href="{php echo mobileUrl('creditshop/log/detail')}&id=<%item.id%>">
                <div class="fui-list">
                    <div class="fui-list-media">
                        <img class="round" src="<%item.thumb%>">
                    </div>
                    <div class="fui-list-inner fui-list-mid" style="margin:0;">
                        <div class="credit-log-list-title" style="font-size:0.7rem;color:#333;">
                            <%if item.goodstype==0%>
                            <span class="fui-label fui-label-primary">商品</span>
                            <%else if  item.goodstype==1%>
                            <span class="fui-label fui-label-success">优惠券</span>
                            <%else if  item.goodstype==2%>
                            <span class="fui-label fui-label-warning">余额</span>
                            <%else if  item.goodstype==3%>
                            <span class="fui-label fui-label-danger">红包</span>
                            <%/if%>
                            <%item.title%>
                            <%if item.optiontitle%>
                                <div class="log-optiontitle">规格：<%item.optiontitle%></div>
                            <%/if%>
                        </div>
                    </div>
                    <div class="fui-list-media" style="margin:0;">
                        <span class="price" style="font-size:0.6rem;color:#f20;text-align: right;">
                            <span class="big"><%item.credit%></span>{$_W['shopset']['trade']['credittext']}
                            <%if item.money > 0%>
                                <br /><span>&yen;<%item.money%><%if item.type==1%>抽奖<%/if%><%if item.type==0%>兑换<%/if%></span>
                            <%/if%>
                        </span>
                    </div>
                </div>
            </a>
            <div class="fui-list fui-list-bottom" style="font-size:0.6rem;">
                <div class="fui-list-inner">
                    <%if item.goodstype==0%>
                        <%if item.isverify==1 && item.status==2%>
                        <span style="color:#f60;">兑奖码：<% item.eno%></span>
                        <%/if%>
                    <%/if%>
                </div>
                <div class="fui-list-media fui-list-bot-inner" data-class="color:#666;" style="margin:0;">
                    <%if item.goodstype==0%>
                        <%if item.isverify==1 && item.status==2%>
                            <a class="btn btn-sm btn-default" href="{php echo mobileUrl('creditshop/verify')}&logid=<%item.id%>&verifycode=<%item.eno%>">
                                <i class="icon icon-qrcode" style="vertical-align: middle;"></i>
                                <span>兑换二维码</span>
                            </a>
                        <%/if%>
                        <!--<%if item.isverify==0 && item.addressid!=0 && item.status==3 && item.time_send > 0 && item.time_finish == 0%>
                            <div class="btn btn-sm btn-default order-finish" href="javascript:void(0);" data-logid="<%item.id%>">确认收货</div>
                        <%/if%>-->
                    <%/if%>
                    <%if item.goodstype==3 && item.status ==2%>
                        <a class="btn btn-sm btn-default btn-packet" data-logid="<%item.id%>" href="javascript:void(0);">领取红包</a>
                    <%/if%>
                    <%if item.isreply==1 && item.iscomment < 2 && item.time_finish > 0%>
                        <%if item.goodstype==0 || item.goodstype==1%>
                            <%if item.status ==3 && item.iscomment == 0 %>
                                <a class="btn btn-sm btn-default" href="{php echo mobileUrl('creditshop/comment')}&goodsid=<%item.goodsid%>&logid=<%item.id%>">评价</a>
                            <%/if%>
                            <%if item.status ==3 && item.iscomment == 1 %>
                                <a class="btn btn-sm btn-default" href="{php echo mobileUrl('creditshop/comment')}&goodsid=<%item.goodsid%>&logid=<%item.id%>">追加评价</a>
                            <%/if%>
                        <%else if item.goodstype==2 || item.goodstype==3%>
                            <%if item.status ==3 && item.iscomment == 0 %>
                                <a class="btn btn-sm btn-default" href="{php echo mobileUrl('creditshop/comment')}&goodsid=<%item.goodsid%>&logid=<%item.id%>">评价</a>
                            <%/if%>
                            <%if item.status ==3 && item.iscomment == 1 %>
                                <a class="btn btn-sm btn-default" href="{php echo mobileUrl('creditshop/comment')}&goodsid=<%item.goodsid%>&logid=<%item.id%>">追加评价</a>
                            <%/if%>
                        <%/if%>
                    <%/if%>
                </div>
            </div>
        </div>
        <%/each%>
    </script>
    <script language="javascript">
        require(['../addons/ewei_shopv2/plugin/creditshop/static/js/log.js'],function(modal){
            modal.init({shine: "{$_GPC['shine']}"});
        });
    </script>
</div>
{php $this->footerMenus()}
{template '_footer'}